package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.AreaInfo;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xuanqicheng
 * @create 2019-08-13:16
 */
@Repository
public class AreaDao {
    @Autowired
    private SqlSession sqlSession;
    public List<String> selectProvinceList() {
        return sqlSession.selectList("selectAreaProvinceList");
    }

    public List<String> selectCityByProvince(String province) {
        return sqlSession.selectList("selectAreaCityByProvince",province);
    }

    public AreaInfo selectAreaCityByName(String city) {
        return sqlSession.selectOne("selectAreaCityByName",city);
    }


    public List<Integer> selectCityNotInCityId(int cityId) {
        return sqlSession.selectList("selectAreaCityNotInCityId",cityId);
    }

    public List<AreaInfo> selectProvinceInfoList() {
        return sqlSession.selectList("selectProvinceInfoList");
    }

    public List<String> selectCityByProvinceId(Integer areaId) {
        return sqlSession.selectList("selectAreaCityByProvinceId",areaId);
    }
}
